<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Strict//EN">
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<title>LEDC</title>
<link rel="stylesheet" type="text/css" href="../style.css">
</head>
<body>

<h2 align="center">LED Compiler for C</h2>

<h3>Description</h3>

  The
  LED compiler (<b>ledc</b>) generates a C module from one or more LED files.
  The C module exports only one function, which builds the IUP interface
  described in the LED files. Running this function is equivalent to calling the
  IupLoad
  function over the original LED files.<o:p> </o:p>
<o:p></o:p>
<p>One
  advantage of using the compiler is that it allows the application to be
  independent from LED files during its execution. Since the interface
  description is inside the executable file, there is no need to worry about
  locating the configuration files.<o:p> </o:p>
<o:p></o:p>
</p>
<p>Another
  advantage is that <b>ledc</b> performs a stricter verification than IUP&#8217;s
  internal parser. This makes error detection in LED files easier.<o:p> </o:p>
<o:p></o:p>
</p>
  Finally, running the function generated by the
  compiler is faster than reading the corresponding LED file with IupLoad, since the parsing step of the LED file is transferred
  from execution to compilation. However, creating the IUP elements described in
  LED takes most of the execution time of the IupLoad function, so the gain in efficiency may not be very
  significant.

<h3>Usage</h3>

<p>ledc [-v] [-c] [-f funcname] [-o file] files</p>
<table align="center">
  <tr>
    <td width="19%">-v</td>
    <td width="81%">shows
        <b>ledc</b>&#8217;s version number</td>
  </tr>
  <tr>
    <td width="19%">-c</td>
    <td width="81%">does
        not generate code, just checks for errors in the LED files</td>
  </tr>
  <tr>
    <td width="19%">-f funcname</td>
    <td width="81%">uses
        &lt;funcname&gt; as the name of the generated exported
        function (default: led_load)</td>
  </tr>
  <tr>
    <td width="19%">-o file</td>
    <td width="81%">uses
        &lt;file&gt; as the name of the generated file (default: led.c)</td>
  </tr>
</table>
<p>&nbsp;</p>

<h3>Error Messages</h3>

<p>Several
  warnings and error messages might be generated during compilation. Errors
  abort the compilation. The messages can be the following:</p>
<p>warning: undeclared control <em>name</em> (argument <em>number</em>)<br>
  The <i>name</i> name was used as an argument where a IUP element
  was expected, but no element with this name was previously declared.</p>
<p>warning: string expected (argument <em>number</em>)<br>
  A
  name (callback?) was passed as a parameter for a string-type argument.</p>
<p>warning: callback expected (argument <em>number</em>)<br>
  A
  string was passed as a parameter for a callback-type argument.</p>
<p>warning: unknown control <em>name</em> used<br>
  An
  unknown element, called <i>name</i>, was used. The compiler assumes the element&#8217;s
  creation function is called Iup<i>Name</i>, with <i>name</i> capitalized, and assumes the arguments&#8217; types based
  on what was passed on LED.</p>
<p>warning: <em>elem</em> declared without a name<br>
  An <i>elem</i>-type element was declared without being associated to
  any name. This declaration creates the element, but it will not be accessible,
  so it cannot be used.</p>
<p>element <em>name</em> already used in line <em>number<br>
</em>The <i>name</i> element was already used in line <i>number</i>. In IUP, the same element cannot have more than one
  parent.</p>
<p>too few arguments for <em>name<br>
</em>The <i>name</i> element expects more arguments than those
  already passed.</p>
<p>too many arguments for <em>name<br>
</em>The <i>name</i> element expects less arguments than those passed.</p>
<p><em>name</em> is not a valid child<br>
  The <i>name</i> element cannot be used as a parameter in this
  case. This happens when trying to insert an image into a vbox, for instance.</p>
<p>control expected (argument <em>number</em>)<br>
  A
  string was passed as a parameter for an element-type argument.</p>
<p>string expected (argument <em>number</em>)<br>
  An
  element was passed as a parameter for a string-type argument. </p>
<p>number expected (argument <em>number</em>)<br>
  An
  element or a string was passed as a parameter for a number-type argument. </p>
<p>callback expected (argument <em>number</em>)<br>
  An
  element was passed as a parameter for a callback-type argument. </p>
<p>hotkeys not implemented<br>
  Even
  though it is a LED word reserved to an element, it is not implemented.</p>
</body>
</html>
